package co.yixiang.mall.biz.bigData.service.impl;

import co.yixiang.common.mproot.common.service.impl.BaseServiceImpl;
import co.yixiang.mall.biz.bigData.mapper.SubstationMapper;
import co.yixiang.mall.biz.bigData.service.SubstationService;
import co.yixiang.mall.common.bigData.domain.Substation;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SubstationServiceImpl extends BaseServiceImpl<SubstationMapper, Substation> implements SubstationService {
    @Autowired
    private SubstationMapper substationMapper;

    @Override
    public Substation query(Substation resources) {
        LambdaQueryWrapper<Substation> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Substation::getIpAddress,resources.getIpAddress()).
                eq(Substation::getPort,resources.getPort()).
                eq(Substation::getDatabaseName,resources.getDatabaseName()).
                eq(Substation::getPassword,resources.getPassword());
        Substation substation = substationMapper.selectOne(wrapper);
        return substation;
    }
}
